{% extends "enterprise/base.html" %}
{% block css %}
{% endblock %}
{% block content %}
            <script type="text/javascript">
                var primary_menu = "menu_0";
                var sub_menu = "menu_0_2";
            </script>
            <div class="col-md-12">
               <form method="post" enctype="application/x-www-form-urlencoded" class="formSubmit">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <div class="panel-title"><h3>三、生态环境保护目标</h3></div>
                        <div class="panel-options">
                            <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
                        </div>
                    </div>
                    <div class="panel-body with-table">
                            <table class="input_in table-detail">
                                <tr>
                                    <th colspan="2">周边是否存在生态环境保护目标</th>

                                     <td colspan="5">
                                         <input type="radio" name="eco_exist" value="1" checked="checked">是
                                            <input type="radio" name="eco_exist" value="0" >否
                                </tr>
                                <tr>
                                    <th width="50">序号</th>
                                    <th>生态环境保护目标名称</th>
                                    <th>方位</th>
                                    <th>距离厂界的距离（米）</th>
                                    <th>操作</th>
                                </tr>
                                {%if details%}
                                {%for detail in details%}
                                <tr class="rowT">
                                    <td>{{forloop.counter}}</td>
                                    <td><input type="text" name="name" value="{{ detail.name }}"  placeholder="请输入" datatype="*"></td>
                                    <td><input type="text"  name="gas_code" value="{{detail.gas_code  }}"  placeholder="请输入" datatype="*"></td>
                                    <td><input type="text"  name="gas_distance" value="{{ detail.gas_distance }}"  placeholder="请输入数字" datatype="n"></td>
                                    {%if forloop.counter == 1%}
			                         <td width=60><input type="button" value="添加" class="btn btn-success" onclick="addSortFile(this)"></td>
			                         {%else%}
			                         <td width=60><input type="button" value="删除" class="btn btn-danger" onclick="delSortFile(this)"></td>
			                         {% endif %}
                                </tr>
                                {% endfor %}
                                {%else%}
                                <tr class="rowT">
                                    <td>1</td>
                                    <td><input type="text" name="name"  placeholder="请输入" datatype="*"></td>
                                    <td><input type="text"  name="gas_code"  placeholder="请输入" datatype="*"></td>
                                    <td><input type="text"  name="gas_distance" placeholder="请输入数字" datatype="n"></td>
                                    <td width=60><input type="button" value="添加" class="btn btn-success" onclick="addSortFile(this)"></td>
                                </tr>
                                {% endif %}
{#                               <tr>#}
{#                                   <td>备注</td>#}
{#                                   <td colspan=7>#}
{#                                        <textarea name="" rows=5 placeholder="请输入"  style="resize:no;"></textarea></td>#}
{#                                </tr>#}
                            </table>
                    </div>
                </div>
                <div class="buttons">
			        <input onclick="submitSave()" type="submit" class="btn btn-orange btn-lg" value="暂存">
                                <input type="submit" class="btn btn-success btn-lg" value="确认">
			        <input class="btn btn-info btn-lg" type="reset" value="重置"/>
			    </div>
			    
			    </form>
            </div>


{% endblock %}

{% block js %}
<script type="text/javascript">
    $(function(){
        var flag = $("input[name='eco_exist']:checked").val();
        if (flag==1) {
            $(".rowT").show();
            // $("table tr").eq(1).show();
        }else{
            $(".rowT").hide();
            // $("table tr").eq(1).hide();
        }
        $("input[name='eco_exist']").click(function(){
            var flag = $("input[name='eco_exist']:checked").val();
            if (flag==1) {
                $(".rowT").show();
                // $("table tr").eq(1).show();
            }else{
                $(".rowT").hide();
                // $("table tr").eq(1).hide();
            }
        })

    });
</script>
{% endblock %}